package com.onec.service.manage.controller;

import com.onec.service.api.annotation.RestfulControllerLog;
import com.onec.service.api.dto.response.BaseResponse;
import com.onec.service.manage.service.user.UserMenuService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 用户菜单资源管理！
 *
 * @author onec
 */
@ApiOperation(value = "用户菜单资源管理")
@RestController
@RequestMapping(value = "/menu")
public class MenuController extends BaseController {

    @Autowired
    UserMenuService userMenuService;


    @RestfulControllerLog(name = "获取用户菜单页面")
    @PostMapping(value = "/getUserMenu")
    public BaseResponse getUserMenu(HttpServletRequest request) {
        Long userId = getUserIdByToken(request);

        return userMenuService.selectUserMenuInfo(userId);
    }

}
